<?php
/**
 * @author PeoneEr
 * 
 */
require_once "core/application/controllers/csettings.php";
$c_settings = new settings_Controller();
$id = $c_settings->catchGETid();
$oneRecord = $c_settings->getInfoForEdit($id);
$fetch = mysql_fetch_assoc($oneRecord);
if ($fetch['setting'] != "language"):
    ?>
    <form action=""  method='POST'>
        <p><?php echo $fetch['name']; ?></p>
        <p><input type='text' name='value' value='<?php echo $fetch['value_setting']; ?>'></p>
        <p><input type='hidden' name='id' value='<?php echo $id; ?>'></p>
        <p><input type='submit' name='save' value='Сохранить'> <a href="index?adm&settings&action=show_settings">Закрыть</a></p>
    </form>
<?php else: ?>
    <form action=""  method='POST'>
        <p><?php echo $fetch['name']; ?></p>
        <select name="value">
            <?php
            if ($fetch['value_setting'] == 0) {
                echo "<option value='0' selected>Русский</option>";
                echo "<option value='1'>Английский</option>";
            }
            if ($fetch['value_setting'] == 1) {
                echo "<option value='1' selected>Английский</option>";
                echo "<option value='0'>Русский</option>";
            }
            ?>
        </select>
        <p><input type='hidden' name='id' value='<?php echo $id; ?>'></p>
        <p><input type='submit' name='save' value='Сохранить'> <a href="index?adm&settings&action=show_settings">Закрыть</a></p>
    </form>

<?php endif;
?>